package com.yoyoyo666.report.controller;

import com.yoyoyo666.report.common.AnnoLogin;
import com.yoyoyo666.report.mapper.ReportPlanMapper;
import com.yoyoyo666.report.mapper.ReportSendLogMapper;
import com.yoyoyo666.report.model.LoginUser;
import com.yoyoyo666.report.model.ReportPlan;
import com.yoyoyo666.report.model.ReportSendLog;
import com.yoyoyo666.report.model.common.ListResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.UUID;

@RestController
@RequestMapping("test")
public class TestController {

    @Autowired
    ReportPlanMapper planMapper;

    @GetMapping("get")
    public Object get(@AnnoLogin LoginUser user){

        ReportPlan rp = new ReportPlan();
        rp.setId(UUID.randomUUID().toString());
        rp.setUserId("1");
        planMapper.insert(rp);
        List<ReportPlan> reportPlans = planMapper.selectAll(user.getCurrentUser().getId(),null);

        return reportPlans;
    }
}
